package com.iot08.api.response;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;

/**
 * @author cwj
 * @description
 * @date 2025/1/14 16:22
 **/
@Data
public class HomePageCommand implements Serializable {

    private Integer isLocationHp;

    private Integer isVideoHp;

    private Integer isPhotoHp;

    private Integer isStepHp;

    private Integer isChatHp;

    private Integer isWifiHp;

    private Integer isDrinkWaterHp;

    private Integer isSedentarinessHp;

    private Integer isAppManagerHp;

    private Integer isAgenetSmsHp;

    private Integer isAutoCallHp;

    private Integer isScreensavorHp;

    private Integer isFindHp;

    private Integer isDialSwitchHp;

    private Integer isFlowerHp;

    private Integer isCostFlowHp;

    private Integer isSchoolTimeTableHp;

    private Integer isVoucherCenterHp;

    private Integer isHeartRateHp;

    private Integer isTemperatureHp;

    private Integer isTimingSwitchHp;

    private Integer isPpmfHp;

    private Integer isDicPenCloudTypeHp;

    private Integer isPhoneBookHp;

    private Integer isAlockHp;

    private Integer isClassForbiddenHp;

    private Integer isSosHp;

    private Integer isRestartHp;

    private Integer isClockHp;

    private Integer isCallRecordHp;

    private Integer isWallpaperHp;

    private Integer isRejectStrangeCallHp;

    private Integer isPowerSavingHp;

    private Integer isSleepDetectionHp;

    /**
     * @description 初始化属性指
     * @author cwj
     * @param [initValue]
     * @return void
     * @date @time 2025/1/14 16:26
     **/
    public void init(int initValue){
        this.setIsLocationHp(initValue);
        this.setIsVideoHp(initValue);
        this.setIsPhotoHp(initValue);
        this.setIsStepHp(initValue);
        this.setIsChatHp(initValue);
        this.setIsWifiHp(initValue);
        this.setIsDrinkWaterHp(initValue);
        this.setIsSedentarinessHp(initValue);
        this.setIsAppManagerHp(initValue);
        this.setIsAgenetSmsHp(initValue);
        this.setIsAutoCallHp(initValue);
        this.setIsScreensavorHp(initValue);
        this.setIsFindHp(initValue);
        this.setIsDialSwitchHp(initValue);
        this.setIsFlowerHp(initValue);
        this.setIsCostFlowHp(initValue);
        this.setIsSchoolTimeTableHp(initValue);
        this.setIsVoucherCenterHp(initValue);
        this.setIsHeartRateHp(initValue);
        this.setIsTemperatureHp(initValue);
        this.setIsTimingSwitchHp(initValue);
        this.setIsPpmfHp(initValue);
        this.setIsDicPenCloudTypeHp(initValue);
        this.setIsPhoneBookHp(initValue);
        this.setIsAlockHp(initValue);
        this.setIsClassForbiddenHp(initValue);
        this.setIsSosHp(initValue);
        this.setIsRestartHp(initValue);
        this.setIsClockHp(initValue);
        this.setIsCallRecordHp(initValue);
        this.setIsWallpaperHp(initValue);
        this.setIsRejectStrangeCallHp(initValue);
        this.setIsPowerSavingHp(initValue);
        this.setIsSleepDetectionHp(initValue);
    }


    /**
     * @description 设置首页显示的指令
     * @author cwj
     * @param [hpc, homePageStr]
     * @return void
     * @date @time 2025/1/14 16:28
     **/
    public void settingHomePageCommand(HomePageCommand hpc, String homePageStr) {
        //初始化默认值
        hpc.init(0);
        if(StringUtils.isNotEmpty(homePageStr)){
            if(homePageStr.contains("LE0")){
                hpc.setIsLocationHp(1);
            }
            if(homePageStr.contains("VE0")){
                hpc.setIsVideoHp(1);
            }
            if(homePageStr.contains("PE0")){
                hpc.setIsPhotoHp(1);
            }
            if(homePageStr.contains("SE0")){
                hpc.setIsStepHp(1);
            }
            if(homePageStr.contains("CE0")){
                hpc.setIsChatHp(1);
            }
            if(homePageStr.contains("WF0")){
                hpc.setIsWifiHp(1);
            }
            if(homePageStr.contains("DW0")){
                hpc.setIsDrinkWaterHp(1);
            }
            if(homePageStr.contains("SN0")){
                hpc.setIsSedentarinessHp(1);
            }
            if(homePageStr.contains("AM0")){
                hpc.setIsAppManagerHp(1);
            }
            if(homePageStr.contains("AS0")){
                hpc.setIsAgenetSmsHp(1);
            }
            if(homePageStr.contains("AC0")){
                hpc.setIsAutoCallHp(1);
            }
            if(homePageStr.contains("SS0")){
                hpc.setIsScreensavorHp(1);
            }
            if(homePageStr.contains("FI0")){
                hpc.setIsFindHp(1);
            }
            if(homePageStr.contains("DS0")){
                hpc.setIsDialSwitchHp(1);
            }
            if(homePageStr.contains("FL0")){
                hpc.setIsFlowerHp(1);
            }
            if(homePageStr.contains("CF0")){
                hpc.setIsCostFlowHp(1);
            }
            if(homePageStr.contains("ST0")){
                hpc.setIsSchoolTimeTableHp(1);
            }
            if(homePageStr.contains("VC0")){
                hpc.setIsVoucherCenterHp(1);
            }
            if(homePageStr.contains("HR0")){
                hpc.setIsHeartRateHp(1);
            }
            if(homePageStr.contains("TE0")){
                hpc.setIsTemperatureHp(1);
            }
            if(homePageStr.contains("TS0")){
                hpc.setIsTimingSwitchHp(1);
            }
            if(homePageStr.contains("PP0")){
                hpc.setIsPpmfHp(1);
            }
            if(homePageStr.contains("DP0")){
                hpc.setIsDicPenCloudTypeHp(1);
            }
            if(homePageStr.contains("PB0")){
                hpc.setIsPhoneBookHp(1);
            }
            if(homePageStr.contains("AK0")){
                hpc.setIsAlockHp(1);
            }
            if(homePageStr.contains("FB0")){
                hpc.setIsClassForbiddenHp(1);
            }
            if(homePageStr.contains("SO0")){
                hpc.setIsSosHp(1);
            }
            if(homePageStr.contains("RG0")){
                hpc.setIsRestartHp(1);
            }
            if(homePageStr.contains("CH0")){
                hpc.setIsClockHp(1);
            }
            if(homePageStr.contains("CR0")){
                hpc.setIsCallRecordHp(1);
            }
            if(homePageStr.contains("WP0")){
                hpc.setIsWallpaperHp(1);
            }
            if(homePageStr.contains("RS0")) {
                hpc.setIsRejectStrangeCallHp(1);
            }
            if(homePageStr.contains("PS0")) {
                hpc.setIsPowerSavingHp(1);
            }
            if(homePageStr.contains("SD0")) {
                hpc.setIsSleepDetectionHp(1);
            }
        }
    }
}
